package com.springlearn.springsourcecode.chap7;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;

/**
 * @author wtcode
 * @Description
 * @date 2025/3/31 - 11:04
 */
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class A07Application {


    public static void main(String[] args) {

        ConfigurableApplicationContext context = SpringApplication.run(A07Application.class, args);
        context.close();


    }

    @Bean(initMethod = "init3")
    public Bean1 bean1(){
        return new Bean1();
    }

    @Bean(destroyMethod = "destory3")
    public Bean2 bean2(){
        return new Bean2();
    }

}
